@import (less) "../macrocosm/index.less";
@import (less) "mod.element.less";
// -------- 宽高固定 -----------------------
.ix-fixed {
  .x-w(@width) {
    min-width: unit(@width, px) !important;
    max-width: unit(@width, px) !important;
    width: unit(@width, px) !important;
  }
  .x-h(@height) {
    min-height: unit(@height, px) !important;
    max-height: unit(@height, px) !important;
    height: unit(@height, px) !important;
  }
}

// -------- 列表消除 -----------------------
.ix-list {
  .none-item(@line-height) {
    list-style: none;
    line-height: unit(@line-height, px);
  }
  .none(@line-height) {
    li {
      .none-item(@line-height);
    }
  }
}

// -------- 文字清除 -----------------------
.ix-text {
  .overflow() {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    /* autoprefixer: off */
    -webkit-box-orient: vertical;
    word-break: break-all;
  }

  .hover-invert(@color) {
    color: @color;

    &:hover {
      color: white;
      background-color: @primary-color;
    }
  }
  .hover-border(@color) {
    color: @color;
    border: solid 1px white;
    &:hover {
      border: solid 1px @color;
      border-radius: 3px;
    }
  }
  .clear-swallow() {
    zoom: 1;

    &::before,
    &::after {
      content: ' ';
      display: table;
    }

    &::after {
      clear: both;
      height: 0;
      font-size: 0;
      visibility: hidden;
    }
  }
}

// -------- 行 ----------------------------
.ix-row {
  .footer(@bottom, @height) {
    margin-bottom: 0 0 @bottom 0 !important;
    height: unit(@height, px) !important;
  }
  .footer(@bottom) {
    .ix-row.footer(@bottom, 38)
  }
  .header(@top, @height) {
    margin-bottom: @top 0 0 0 !important;
    height: unit(@height, px) !important;
  }
  .header(@top) {
    .ix-row.header(@top, 38)
  }
}

.ix-form {
  .error(@color) {
    background-color: @color;
    color: white;

    .ix-border.round(@color, 3);
    .ix-pos.absolute(100);
    padding: 2px 5px;
    /** From Animate.css **/
    animation-duration: 1s;
    animation-fill-mode: both;
    animation-name: bounceIn;
  }
}
